package io.adrainty.bolee.file.models.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.adrainty.bolee.file.models.valobj.FileStorageEnum;
import io.adrainty.bolee.file.models.valobj.FileUploadStatus;
import io.adrainty.bolee.framework.commons.basic.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.io.Serial;
import java.util.List;

/**
 * <p>FileEntity</p>
 *
 * @author AdRainty
 * @version V1.0.0
 * @description 文件
 * @since 2025/8/12 11:07:09
 */

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "文件")
@EqualsAndHashCode(callSuper = true)
public class FileEntity extends BaseEntity {

    @Serial
    private static final long serialVersionUID = -2589975069749872383L;

    @Schema(description = "业务ID")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long businessId;

    @Schema(description = "业务类型")
    private String businessType;

    @Schema(description = "后缀名")
    private String suffix;

    @Schema(description = "文件名")
    private String fileName;

    @Schema(description = "访问路径")
    private String pathUrl;

    @Schema(description = "存储标识（不同的存储标识参考FileConstant）,现支持 aliyunoss、qiniu ")
    private FileStorageEnum storeFlag;

    @Schema(description = "存储空间名称")
    private String bucketName;

    @Schema(description = "base64图片")
    private String base64Image;

    @Schema(description = "分片上传文件Id")
    private String uploadId;

    @Schema(description = "是否自动生成文件存储目录,如果在storeFilename指定了目录，此值设置为false")
    private Boolean autoCatalog;

    @Schema(description = "md5值")
    private String md5;

    @Schema(description = "分片上传分片信息")
    private List<String> partETags;

    @Schema(description = "上传状态")
    private FileUploadStatus status;

    @Schema(description = "企业号")
    private String companyNo;

    @Schema(description = "历史上传:0 历史有此文件 1、历史无此文件")
    private String isHistory;

}
